package cz.proks.easyhelpdesk.gwt.ui.widget;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;

import cz.proks.easyhelpdesk.gwt.event.HasLeftArrowClickHandlers;
import cz.proks.easyhelpdesk.gwt.event.HasRightArrowClickHandlers;
import cz.proks.easyhelpdesk.gwt.event.LeftArrowClickEvent;
import cz.proks.easyhelpdesk.gwt.event.RightArrowClickEvent;

public class LeftRightHyperlinkButton extends Composite implements HasLeftArrowClickHandlers, HasRightArrowClickHandlers {

    private static LeftRightHyperlinkButtonUiBinder uiBinder = GWT.create(LeftRightHyperlinkButtonUiBinder.class);

    interface LeftRightHyperlinkButtonUiBinder extends UiBinder<Widget, LeftRightHyperlinkButton> {
    }

    @UiField LeftArrowHyperlinkButton leftHyperlink;
    @UiField RightArrowHyperlinkButton rightHyperlink;
    
    public LeftRightHyperlinkButton() {
        initWidget(uiBinder.createAndBindUi(this));
    }

    public LeftArrowHyperlinkButton getLeftHyperlink() {
        return leftHyperlink;
    }

    public RightArrowHyperlinkButton getRightHyperlink() {
        return rightHyperlink;
    }    
    
    public HandlerRegistration addLeftArrowClickHandler(LeftArrowClickEvent.Handler handler) {
        return leftHyperlink.addLeftArrowClickHandler(handler);
    }
    
    public HandlerRegistration addRightArrowClickHandler(RightArrowClickEvent.Handler handler) {
        return rightHyperlink.addRightArrowClickHandler(handler);
    }
}
